#include<stdio.h>
int main()
{
    int x[200];
    int count = 0;
    freopen("in.txt","r",stdin);
    int n;
    scanf("%d",&n);
    for(int i = 0; i < n; i++) scanf("%d",&x[i]);
    for(int i = 0; i < n; i++)
    {
        int min = i;
        for(int j = i; j < n; j++)
        {
            if(x[j] < x[min]) min = j;
        }
            int temp = x[min];
            x[min] = x[i];
            x[i] = temp;
            count++;
    }
    for(int i = 0; i < n; i++) printf("%d ",x[i]);
    printf("\n%d",count);
}